package com.legendary.awesome;

//import com.legendary.awesome.DataModels.Contact;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ViewContactsInfo extends Activity
{
	//private Contact contact = null;
	
	private TextView tv_name = null;
	private TextView tv_bday = null;
	private TextView tv_address = null;
	private TextView tv_email = null;
	private TextView tv_tlf = null;
	
	private LinearLayout layout = null;
	
	private ImageButton ib_edit = null;
	private ImageButton ib_msg = null;
	private ImageButton ib_call = null;
		
	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.view_contacts);
        
        initComponents();
        
        getExtraAndPopulateTV();        
    }
	
	public void initComponents()
	{
		tv_name = (TextView) findViewById(R.id.tv_con_name_id);
		tv_bday = (TextView) findViewById(R.id.tv_v_bday);
		tv_address = (TextView) findViewById(R.id.tv_v_address);
		tv_email = (TextView) findViewById(R.id.tv_v_email);
		tv_tlf = (TextView) findViewById(R.id.tv_v_tlf);
		
		
		ib_edit = (ImageButton) findViewById(R.id.b_vc_edit);
		ib_msg = (ImageButton) findViewById(R.id.b_vc_textmsg);
		ib_call = (ImageButton) findViewById(R.id.b_vc_call);
				
		layout = (LinearLayout) findViewById(R.id.hidden_layout);
	}
	
	public void getExtraAndPopulateTV()
	{
		Intent i = getIntent();
		
		if(i != null)
		{
			tv_name.append(i.getStringExtra("name"));
			
			if(i.getStringExtra("address") != null)
			{
				tv_address.append(" " + i.getStringExtra("address"));
			}
			
			if(i.getStringExtra("bday") != null)
			{
				tv_bday.append(" " + i.getStringExtra("bday"));
			}
			
			if(i.getStringExtra("email") != null)
			{
				tv_email.append(" " + i.getStringExtra("email"));
			}
			
			if(i.getLongExtra("tlf",-1) >= 0)
			{
				tv_tlf.append(" " + i.getLongExtra("tlf",-1)+"");
			}
		}
	}
}
